﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Orid.Management.Statistics.Tools.Decomposition.Model
{
    class ModelInputObject:ModelBase
    {


        public Guid InputId { get; set; } 

        public Guid BlockId { get; set; }

        public Guid FrameId { get; set; }

        public int CategoryID { get; set; }


        //block 中的附属信息 得不到; 
        public int WorldCounts { get; set; } 
       
        public string αβAttachWordsResult { get; set; } 

        public bool αβAttachFlag { get; set; }






        List<ModelEntryObject> abEntryList = new List<ModelEntryObject>(),
                                dEntryList = new List<ModelEntryObject>(),
                                eEntryList = new List<ModelEntryObject>(),
                                judgeEntryList = new List<ModelEntryObject>();

        /// <summary>
        /// Judge Job entry List
        /// </summary>
        internal List<ModelEntryObject> JudgeEntryList
        {
            get { return judgeEntryList; }
            set { judgeEntryList = value; }
        }

 

        internal List<ModelEntryObject> EEntryList
        {
            get { return eEntryList; }
            set { eEntryList = value; }
        }

        /// <summary>
        /// DEntryList
        /// </summary>
        internal List<ModelEntryObject> DEntryList
        {
            get { return dEntryList; }
            set { dEntryList = value; }
        }
        /// <summary>
        /// AEntry && BEntry list
        /// </summary>
        internal List<ModelEntryObject> ABEntryList
        {
            get { return abEntryList; }
            set { abEntryList = value; }
        }


        internal ModelEntryObject FinalEntry { get; set; }

        internal ModelEntryObject OcrEntry { get; set; }

        internal ModelEntryObject JudgeBEntry { get; set; }

        internal ModelEntryObject JudgeAEntry { get; set; }
        
        internal ModelEntryObject EEntry { get; set; }
        
        internal ModelEntryObject DEntry { get; set; }
        
        internal ModelEntryObject BEntry { get; set; }
        
        internal ModelEntryObject βEntry { get; set; }

        internal ModelEntryObject AEntry { get; set; }
        
        internal ModelEntryObject αEntry { get; set; }
         
        public Guid OrderID { get; set; }

        /// <summary>
        /// 坐标
        /// </summary>

        /// <summary>
        /// 相对block input的索引位置
        /// </summary>
        public int Index { get; set; } 
        public int X { get; set; }

        public int Y { get; set; }

        public int Width { get; set; }

        public int Height { get; set; }
     

        public int JudgeErrorCount { get; set; } 

        List<ModelProgress> listModelProgress = new List<ModelProgress>();

        public List<ModelProgress> ListModelProgress
        {
            get { return listModelProgress; }
            set { listModelProgress = value; }
        }



        public Guid? DataStoreID { get; set; }

 

        public int FileSize { get; set; }
         
        //R32 add 
        [Obsolete("R33版没有IsDelivery",true)]
        public int IsDelivery { get; set; }


        public ModelProperty MProperty { get; set; }


        protected override void GetException()
        {
            //检测代码
            if ((ABEntryList!=null) && (ABEntryList.Count > 1))
            {
                AddException("ABEntryResultCountException",
                    "AB录入结果数量异常。" + "结果数量：" + ABEntryList.Count.ToString() + ";InputID=" + InputId .ToString());
            }
            if ((AEntry!=null) && (AEntry.Duration > _durationMax) )
             {
                    AddException("AResultDurationException",
                                             "A结果录入时间异常。" + "结果录入时间(S):" + AEntry.Duration.ToString() + ";AjobID=" + AEntry.JobID.ToString());
             }
            if ((BEntry!=null) && (BEntry.Duration > _durationMax))
            {
                AddException("BResultDurationException",
                                         "B结果录入时间异常。" + "结果录入时间(S):" + BEntry.Duration.ToString() + ";BjobID=" + BEntry.JobID.ToString());
            }

            //检测代码
            if (DEntryList.Count > 1)
            {
                AddException("DEntryResultCountException",
                    "D录入结果数量异常。" + "结果数量：" + DEntryList.Count.ToString() + ";InputID=" + InputId.ToString());
            }
            if ((DEntry != null) && (DEntry.Duration > _durationMax))
            {
                AddException("DResultDurationException",
                                         "D结果录入时间异常。" + "结果录入时间(S):" + DEntry.Duration.ToString() + ";DjobID=" + DEntry.JobID.ToString());
            }


            if (EEntryList.Count > 1)
            {
                AddException("EEntryResultCountException",
                   "E录入结果数量异常。" + "结果数量：" + EEntryList.Count.ToString() + ";InputId=" + InputId.ToString());
            }
            if ((EEntry != null) && (EEntry.Duration > _durationMax))
            {
                AddException("EResultDurationException",
                                         "E结果录入时间异常。" + "结果录入时间(S):" + EEntry.Duration.ToString() + ";EjobID=" + EEntry.JobID.ToString());
            }


        }

    }
}
